[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
getbkcolor() Get the Current Background Color
#include <graphics.h>
int far getbkcolor(void);
getbkcolor() returns the current background color which can be one of
the following values defined in <graphics.h>:
Value Name
0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 LIGHTGRAY
8 DARKGRAY
9 LIGHTBLUE
10 LIGHTGREEN
11 LIGHTCYAN
12 LIGHTRED
13 LIGHTMAGENTA
14 YELLOW
15 WHITE
Returns: The value of the current background color.
-------------------------------- Example ---------------------------------
The following statements save the original background color, set the
background color to a new value and then restore the original color.
#include <graphics.h>
#include <conio.h>
int gdriver = DETECT;
int gmode;
main()
{
int whcolor;
initgraph(&gdriver,&gmode,"");
whcolor = getbkcolor();
setbkcolor(4);
getch();
cleardevice();
setbkcolor(whcolor);
closegraph();
}
See Also:
getcolor()
getpalette()
getmaxcolor()
setbkcolor()
setcolor()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson